Running ISETL

ISETL is an interpreted, interactive version of the programming language SETL. Written in C, it is invoked by typing a command line with the executable name, say

isetl

, along with optional file names that are discussed below.1

There is no compiler for ISETL. When ISETL is running, it prompts for input with the character ``

>

''. Input consists of a sequence of expressions (each terminated by a semicolon ``

;

''), statements, and programs. Each input is acted upon as soon as it is entered. The result of this action is explained below. In the case of expressions, the result includes its value being sent to standard output. If you have not completed your entry, you will receive the prompt ``

> >

'', indicating that more is expected.

  1. ISETL is exited by typing ``

    !quit

    ''. It may also be exited by ending the standard input. (In Unix, this is done by typing ctrl-D).

  2. A common mistake is omitting the semicolon after an expression. ISETL will wait until it gets a semicolon before proceeding — even if a carriage return is entered. The doubled prompt ``

    > >

    '' indicates that ISETL is expecting more input.

  3. ISETL can get its input from sources other than the standard input.

    1. If there is a file with the name ``

      .isetlrc

      '' in the current directory, then the first thing ISETL will do is read this file. 2

    2. Next, if the command line has any file names listed, ISETL will read each of these in turn. 3

      Thus, if the command line reads,

      
      isetl file.1 foo bar 
      

      ISETL will first read from the ``

      .isetlrc

      '' file, if it exists, and then from the file ``

      file.1

      '', then from ``

      foo

      '', and then from ``

      bar

      ''. Finally, it is ready for input from the terminal. (This is only available under UNIX and MSDOS.)

    3. If there is a file available with the name, say ``

      file.2

      '' and ISETL is given (at any time), the input,

      
      !include file.2 
      

      (notice that there is no semicolon), then it will take its input from ``

      file.2

      '' before being ready for any further input. The material in such a file is treated exactly as if it were typed directly to the terminal, and it can be followed by any additional information that the user would like to enter.

      Consider the following (rather contrived) example: Suppose that the file ``

      file.3

      '' contained the following data,

      
      5, 6, 7, 3, -4, "the" 
      

      Then if the user typed,

      
          >   seta := {
      
      » !include file.3
      !include file.3 completed
      » , x };

      the effect would be exactly the same as if the user had entered,

      
          > seta := {5, 6, 7, 3, -4, "the", x};
      

      The line ``

      !includefile.3completed

      '' comes from ISETL and is always printed after an ``

      !include

      ''.

  4. Comments

    If a dollar sign ``

    $

    '' appears on a line, then everything that appears until the next carriage return is ignored by ISETL.

  5. After a program or statement has executed, the values of global variables persist. The user can then evaluate expressions in terms of these variables. (See below for more detail on scope.)